execute as @e[type=item_frame,nbt={Tags:["entity_bouncer"]}] run data modify entity @s Item set value {id:"minecraft:arrow",Count:1b}
execute as @e[type=item_frame,nbt={Tags:["entity_bouncer_bottom"]}] run data modify entity @s Item set value {id:"minecraft:arrow",Count:1b}
execute as @e[type=item_frame,nbt={Tags:["entity_up_bouncer"]}] run data modify entity @s ItemRotation set value 0

execute as @e[type=item_frame,nbt={Tags:["entity_up_bouncer"]}] at @s if entity @e[distance=..1.5,type=item_frame,nbt={Tags:["wire"]},tag=hasPower] run function advm:machines/entity_bouncer_bounce
execute as @e[type=item_frame,nbt={Tags:["entity_bouncer_bottom"]}] at @s if entity @e[distance=..1.5,type=item_frame,nbt={Tags:["wire"]},tag=hasPower] run function advm:machines/entity_bouncer_bounce
execute as @e[type=item_frame,nbt={Tags:["entity_bouncer"]}] at @s if entity @e[distance=..1.5,type=item_frame,nbt={Tags:["wire"]},tag=hasPower] run function advm:machines/entity_bouncer_bounce
execute as @e[type=item_frame,nbt={Tags:["entity_bouncer"]}] at @s unless block ~ ~-1 ~ yellow_glazed_terracotta run kill @s
execute as @e[type=item_frame,nbt={Tags:["entity_up_bouncer"]}] at @s unless block ~ ~-1 ~ magenta_glazed_terracotta run kill @s
execute as @e[type=item_frame,nbt={Tags:["entity_bouncer_bottom"]}] at @s unless block ~ ~1 ~ green_glazed_terracotta run kill @s